﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage< QLPKWeb.Models.FormBean.ProfileModel.ChangePassForm>" %>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
    <script type="text/javascript" language="javascript" src="<%= ResolveUrl("~/Content/Scripts/Profile/ChangePassword.js") %>"></script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function() {
            $("#CurrentPassword").focus();
        });
    
    </script>
    <div class="box">
        <div class="title">
            <h5>
                &nbsp;Thay đổi Password</h5>
        </div>
        <form id="form1" name="form" method="post" action="">
        <%
                var userLogin = (string[])ViewData["userLogin"];
        %>
        <input type="hidden" id="username" name="username" value='<%=userLogin[0]%>' />
        <input type="hidden" id="password" name="password" value='<%=userLogin[1]%>' />
        <input type="hidden" id="newpassword" name="newpassword" value='' />
        <br />
        <table width="100%" class="table_input">
            <tbody>
                <%//Change password thành công
                    if ((string)ViewData["ChangePasswordStatus"] == "true")
                    {
                %>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td style="color: Blue" colspan="2" id="TrueMessage">
                        Thay đổi Mật khẩu thành công !
                    </td>
                </tr>
                <%
                    }
                %>
                <%//change password thất bại
                        if ((string)ViewData["ChangePasswordStatus"] == "false")
                    {
                %>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td style="color: red" colspan="2" id="FalseMessage">
                        Thay đổi Mật khẩu thất bại !
                    </td>
                </tr>
                <%
                    }
                %>
                <tr>
                    <td width="30%" align="right">
                       Mật khẩu hiện tại :
                    </td>
                    <td width="25%">
                        <input type="password" id="CurrentPassword" name="CurrentPassword" style="width:90%" value=""
                            onkeypress="if (event.keyCode==13) { return DoResetPassword(); }" onkeydown="javascript:doFocus();" />
                    </td>
                    <td>
                        <div id="CurrentPasswordNote" style="color: Red" class="required">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        Nhập Mật khẩu mới :
                    </td>
                    <td nodwrap="nowrap">
                        <input type="password" id="NewPassword" style="width:90%" value="" onkeypress="if (event.keyCode==13) { return DoResetPassword(); }" />
                    </td>
                    <td>
                        <div id="NewPasswordNote" style="color: Red">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        Nhập lại Mật khẩu mới :
                    </td>
                    <td>
                        <input type="password" id="ConfirmNewPassword" style="width:90%" value="" onkeypress="if (event.keyCode==13) { return DoResetPassword(); }" />
                    </td>
                    <td>
                        <div id="ConfirmNewPasswordNote" style="color: Red">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                    </td>
                    <td align="left" colspan="2">
                        <input type="button" name="reset"  value="Đổi mật khẩu" onclick="javascript:DoResetPassword();" />
                        <input type="reset" name="cancel"  value="Nhập lại" />
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        </form>
    </div>
</asp:Content>
